package continuation

import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.future.future
import kotlinx.coroutines.launch
import java.io.Serializable


//private suspend fun getData(): String {
//    // LABEL0
//    delay(1000)
//    // LABEL 1
//    delay(2000)
//    // LABEL 2
//    delay(3000)
//    return "123"
//}

private suspend fun getData(): String {
    return "123"
}

private suspend fun parseData(str: String): Int {
    return str.toInt()
}

fun main(args: Array<String>) {
    GlobalScope.launch {
        val data = getData()
        val result = parseData(data)
        println("result: $result")
    }
}